home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 2.iso
/
toolbox
/
perfTuning
/
gldstats
< prev
next >
Wrap
Text File
|
1996-11-11
|
1KB
|
82 lines
#!/bin/sh
awk '
BEGIN {
FS = "(";
cnt_sm_lines = 0;
cnt_med_lines = 0;
cnt_lg_lines = 0;
cnt4vp = 0;
cnt3vp = 0;
cntNvp = 0;
cntmesh = 0;
cntdegenp = 0;
inpoly = 0;
inmesh = 0;
inline = 0;
vertc = 0;
}
{
if (index($0, "(") == 0) {
next;
}
cmd = $1;
if (cmd == "bgnpolygon") {
vertc = 0;
inpoly = 1;
} else if (cmd == "bgntmesh") {
vertc = 0;
inmesh = 1;
} else if (cmd == "bgnline") {
vertc = 0;
inline = 1;
} else if (cmd == "endpolygon") {
inpoly = 0;
if (vertc == 3) {
cnt3vp += 1;
}
else if (vertc == 4) {
cnt4vp += 1;
}
else if (vertc > 4) {
cntNvp += 1;
} else {
cntdegenp += 1;
}
} else if (cmd == "endtmesh") {
inmesh = 0;
if (vertc > 2) {
cntmesh += vertc - 2;
} else {
cntdegenp += 1;
}
} else if (cmd == "endline") {
inline = 0;
if (vertc <= 10) {
cnt_sm_lines += 1;
}
else if (vertc <= 15) {
cnt_med_lines += 1;
}
else {
cnt_lg_lines += 1;
}
} else if ((inpoly || inmesh || inline) && (cmd == "v3f")) {
vertc += 1;
}
}
END {
printf "\tMesh Tris: %d\n", cntmesh;
printf "\tPolygon counts:\n";
printf "\ttriangles: %d\n", cnt3vp;
printf "\tquads: %d\n", cnt4vp;
printf "\t5+ verts: %d\n", cntNvp;
printf "degenerates (<2 verts): %d\n", cntdegenp;
printf "\tlines<10: %d\n", cnt_sm_lines;
printf "\tlines<15: %d\n", cnt_med_lines;
printf "\tlines>15: %d\n", cnt_lg_lines;
}
' $1